package org.ar.gameserver.common.util;

import java.util.HashMap;
import java.util.Map;

public class Message<T> {

	public static final String KEY_1 = "messageHead";
	
	public static final String KEY_2 = "returnObject";
	
	public static final String KEY_3 = "exception";
	
	private Map<String, Object> dataPackage;
	
	public Message() {
		dataPackage = new HashMap<String, Object>();
	}
	
	public Message(Map<String, Object> map) {
		dataPackage = map;
	}
	
	public Map<String, Object> getDataPackage() {
		return dataPackage;
	}
	
	public String getMessageHead(){
		return (String)dataPackage.get(KEY_1);
	}
	
	public T getReturnObject(){
		return (T)dataPackage.get(KEY_2);
	}
	
	public String getException(){
		return (String)dataPackage.get(KEY_3);
	}
	
	public void setMessageHead(String messageHead){
		dataPackage.put(KEY_1,messageHead);
	}
	
	public void setReturnObject(T returnObject){
		dataPackage.put(KEY_2,returnObject);
	}
	
	public void setException(String exception){
		dataPackage.put(KEY_3,exception);
	}
}
